{% extends "base.html" %}
{% block head %}
<style>
	h2 .button{
		font-size:14px;
		font-weight:normal;
		line-height:20px;
	}
	#postList{
		margin-right:20px;
	}
	#postList table{
		width:100%; 
		border:solid 1px #d4d4d4;
	}
	#postList td,#postList th{
		text-align:left;
		padding-left:10px;
		height:30px;
		border-bottom:solid 1px #d4d4d4;
	}
	#postList th{
		background:#eee;
	}
	#postList .title{
		width:450px;
	}
	#postList .categ{
		width:250px;
	}
	.selete{
		width:50px;
	}
	.postTab a{
		text-decoration:none;
		color:#000;
	}
	.postListhead,.postTab{
		margin:10px 0;
	}
	.postListhead input{
		margin-right:20px;
	}
</style>
{% endblock %}
{% block contentWrap %}
<div id="postList">
	<h2>文章 <a href="/admin/newPost" class="button">添加新文章</a></h2>
	<div class="postTab"><a href="/admin/postList">全部({{allCount}})</a> | <a href="/admin/postList?postStatus=posted">已发布({{hasPostedCount}})</a> | <a href="/admin/postList?postStatus=draft">草稿（{{draftCount}}）</a></div>
	<div class="postListhead">
		<select>
			<option>批量操作</option>
			<option>删除</option>
		</select>
		<input type="button" value="应用" />
		<select>
			<option>显示所有日期</option>
		</select>	
		<select>
			<option>批量操作</option>
		</select>
		<input type="button" value="过滤" />
	</div>
	<table>
		<thead>
			<tr>
				<th class="selete"><input type="checkbox" class="seleteAll"/></th>
				<th class="title">标题</th>
				<th class="categ">分类</th>
				<th>评论</th>
				<th>更新日期</th>
			</tr>
		</thead>
		<tbody>
			{% for post in posts %}
			<tr>
				<td><input type="checkbox" class="seleteAll"/></td>
				<td><a href="/admin/editPost?id={{post.id}}">{{post.title}}</a></td>
				<td>{{post.name}}</td>
				<td>{{post.commentCount}}</td>
				<td>{{post.postTime}}</td>
			</tr>	
			{% endfor %}
		</tbody>
	</table>
</div>
{% endblock %}
